package com.lishe.lishe.lishe.module.search.adapter;


import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.lishe.lishe.R;
import com.lishe.lishe.lishe.MyRecyclerView.RecyclerviewBaseAdapter;

import java.util.List;

/**
 * Created by Bin
 */

public class SearchInputConnectAdapter extends RecyclerviewBaseAdapter {

    private Context mContext;
    private List<String> mList;

    public SearchInputConnectAdapter(Context context, List<String> list){
        this.mContext = context;
        this.mList = list;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolderMy(ViewGroup parent, int viewType) {
        View view= LayoutInflater.from(mContext).inflate(R.layout.item_inputconnect,null);
        return new MyViewHolder(view);
    }

    @Override
    public void onBindViewHolderMy(RecyclerView.ViewHolder holder, int position) {
        ((MyViewHolder)holder).text.setText(mList.get(position));
    }

    @Override
    public int getItemCountMy() {
        return mList.size();
    }

    @Override
    public int getItemViewTypeMy(int position) {
        return 0;
    }

    public class MyViewHolder extends RecyclerView.ViewHolder{
        TextView text;

        public MyViewHolder(View itemView) {
            super(itemView);
            text = itemView.findViewById(R.id.text);
        }
    }

}
